var rootDocment = 'http://yunjianbao.com/shopapi.php';//你的域名
//var rootDocment = 'https://toocle.y.netsun.com/index.php/Home';//你的域名
import tips from 'Tips'
var code = '171bc226116b35f08c45d54019a'
function req(url, data, cb){
    data.apicode=code
    wx.request({
        url: rootDocment + url,
        data: data,
        method: 'POST',
        header: {'Content-Type': 'application/x-www-form-urlencoded'},
        success: function (res) {
            return typeof cb == "function" && cb(res.data)
        },
        fail: function () {
            return typeof cb == "function" && cb(false)


        }, complete: function (res) {


        },
    })
}
function reqload(url, data, cb) {
    tips.loading()
    wx.request({
        url: rootDocment + url,
        data: data,
        method: 'POST',
        header: {'Content-Type': 'application/x-www-form-urlencoded'},
        success: function (res) {
            tips.loaded()
            return typeof cb == "function" && cb(res.data)
        },
        fail: function () {
            return typeof cb == "function" && cb(false)


        }, complete: function (res) {


        },
    })
}
module.exports = {
    req: req,
    reqload:reqload
}


